package asteroids.model.expressions;

import java.util.HashMap;

import asteroids.model.*;

/**
 * A subclass of expression (E) that represents an entity
 * 
 * @version 1.0
 * 
 * @author	Thijs Peirelinck & Wouter Parys
 *
 */
public class EntityLiteral extends BasicExpression {
	
	private FlyingObject object;
	
	public EntityLiteral(FlyingObject object) {
		this.object = object;
	}

	@Override
	public FlyingObject getValue() {
		return object;
	}

	@Override
	public boolean isValidExpression() {
		return true;
	}

	@Override
	public String getReturnType() {
		return "entity";
	}

	@Override
	public String toString() {
		return "entity" + object.getClass();
	}

	@Override
	public void setExecuter(Ship executer) {
		//do nothing
	}

	@Override
	public E createCopy() {
		return new EntityLiteral(getValue());
	}
	
	@Override
	public void validate(HashMap<String, E> variables) {
		//do nothing
	}

}
